//index.js
//获取应用实例
const app = getApp()
const mineService = require('../../service/mine.js');

Page({
  data: {
    title:"个人中心",
    detailInfo:{}
  },
  onLoad: function () {
    if(app.checkLogin()){
      this.getIndex();
    }
  },
  onShow: function(){
    if(app.checkLogin()){
      this.getIndex();
    }
  },
  getIndex(){
    let d = {
      unionId:app.globalData.userinfo.unionId
    }
    mineService.getIndex(d).then(res => {
      if (res.resCode == 0){
        this.setData({
          detailInfo:res.object
        })
      }
    })
  }
})
